home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 256_02 / printerr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-01-06  |  1.0 KB  |  31 lines

  1. /*-------------------------------------------------------------------*/
  2. /*    LIBRARY FILE:     PRINTERR.C
  3.     ------------
  4.     WRITTEN:          26/10/87
  5.     -------
  6.     PURPOSE:          Prints the message corresponding to the error
  7.     -------           code returned by a function.
  8.  
  9.     USAGE:            void PRINTERR(errcode)
  10.     -----             int errcode;
  11.  
  12.     DEPENDENCIES:     De Smet C V 2.44+
  13.     ------------
  14.     Copyright 1987 - Cogar Computer Services Pty. Ltd                */
  15. /*-------------------------------------------------------------------*/
  16. #include <stdio.h>
  17. #include <c:errlist.c>
  18.  
  19. void printerr(errcode)
  20. int errcode;
  21. {
  22.     if (abs(errcode) >= errtablesize)  /* Then error code is unknown */
  23.     {
  24.         printf("\nError Code - %d - is unknown to us.....bye!\n", errcode);
  25.         exit(0);
  26.     }
  27.     else errcode = abs(errcode);
  28.     printf("\n%s\n", errlist[errcode]);
  29. }
  30. /*-------------------------------------------------------------------*/
  31.